#ifndef TITLERIBBONBAR_H
#define TITLERIBBONBAR_H
#include "titlebar.h"
#include "ribbonbar.h"

// TitleRibbonBar 宽度
static const int TitleRibbonBarWidth = 135;



class TitleRibbonBar : public QWidget
{
    Q_OBJECT
public:
    explicit TitleRibbonBar(TitleBarElementTypes types, QWidget *parent = nullptr);
    ~TitleRibbonBar();
public:
    // 设置标题栏元素
    void setTitleBarElement(TitleBarElementType type,
                            const QString content);
    // 添加Ribbon工具栏类别
    void addRibbonToolBar(RibbonToolBar *toolbar);
    // 添加Ribbon工具栏下工具分组
    void addRibbonToolButtonGroup(RibbonToolBar *toolbar,
                                  RibbonToolButtonGroup *group);
    // 添加Ribbon工具栏--工具分组下按钮
    void addRibbonToolButton(RibbonToolBar *toolbar,
                             RibbonToolButtonGroup *group,
                             RibbonToolButton *ribbonToolButton);
signals:
    void changeSkin(QString skinFile);
protected:
    //继承QWidget，则需要重写paintEvent函数，否则无法使用QSS
    void paintEvent(QPaintEvent* e) Q_DECL_OVERRIDE;

protected slots:
    void dealSkinChange(QString skinFile);
private:
    QVBoxLayout *layout  = nullptr;
    MainWindowTitleBar *titleBar   = nullptr;
    RibbonBar *ribbonBar = nullptr;

};

#endif // TITLERIBBONBAR_H
